<?php
/**
 * 周舟 hzboye010@163.com
 * addby sublime snippets
 * 举报 测试类
 */

namespace app\test\controller;

use app\test\controller\Ava;
use app\utils\BoyeService;

class CoreReport extends Ava{
    //帖子举报
    public function report(){
        if(IS_AJAX){
            $data = [
            'report_type' => I('post.report_type',''),
            'report_id'   => I('post.report_id',''),
            'uid'         => I('post.uid',''),
            'op_uid'      => I('post.op_uid',''),
            'reason'      => I('post.reason',''),
						'api_ver'     => $this->api_ver,
						'notify_id'   => $this->notify_id,
						'alg'         => $this->alg,
						'type'        => 'BY_CoreReport_report',
          ];

          $service = new BoyeService();
          $result = $service->callRemote("",$data,true);
          echo $this->parseResult($result);
        }else{
          $this->assign('type','BY_CoreReport_report');
          $this->assign('field',[
            ['api_ver','100',LL('need-mark api version')],
            ['report_type',0,LL('need-mark report-type')],
            ['report_id',1,L('need-mark report-ID')],
            ['uid',153,LL('need-mark user ID')],
            ['op_uid',143,LL('need-mark report-user ID')],
            ['reason','',LL('need-mark reason')],
          ]);
          echo $this->display('ava/test');
        }
    }

}